{include file="header.html"}
<body class="gr">

<div class="navBar">
	<a class="left" href="javascript:history.back()"><i class="return"></i></a>
	<div class="titleView-x">{if $type==2}视频教程{else}用户手册{/if}</div>
	<a class="right" href="tel://020-82581511"><i class="member-call"></i></a>
</div>

<div class="server-video main-padding-top">
	<div class="pullRefresh">
		<div class="category ge-bottom">{$name}</div>
		<ul class="list explain-list">
			{foreach from=$data.servers item=g}
			<li>
				<a href="wap.php?app=member&act=server_detail&id={$g->id}">
					<div class="img" style="background-image:url({$g->pic});"></div>
					<div class="title">{$g->title}</div>
				</a>
			</li>
			{foreachelse}
			<div class="norecord">暂无内容</div>
			{/foreach}
		</ul>
	</div>
</div>
{include file="footer.html"}
<script>
var offset = $('.pullRefresh .list > li').length;
function createHtml(g){
	var html = '<li>\
		<a href="wap.php?app=member&act=server_detail&id='+g.id+'">\
			<div class="img" style="background-image:url('+g.pic+');"></div>\
			<div class="title">'+g.title+'</div>\
		</a>\
	</li>';
	offset++;
	return html;
}
$(function(){
	$('.server-video').height($.window().height-$('.server-video').padding().top);
	$('.pullRefresh').pullRefresh({
		header : true,
		footer : true,
		footerNoMoreText : '- END -',
		refresh : function(fn){
			var _this = this;
			offset = 0;
			$.getJSON('api.php?app=member&act=server_video&type={$type}', function(json){
				if(json.error!=0){ $.overloadError(json.msg);return; }
				var html = '';
				if($.isArray(json.data.servers))for(var i=0; i<json.data.servers.length; i++)html += createHtml(json.data.servers[i]);
				_this.find('.list').html(html);
				fn();
			});
		},
		load : function(fn){
			var _this = this;
			$.getJSON('api.php?app=member&act=server_video&type={$type}', { offset:offset }, function(json){
				if(json.error!=0){ $.overloadError(json.msg);return; }
				var html = '';
				if($.isArray(json.data.servers))for(var i=0; i<json.data.servers.length; i++)html += createHtml(json.data.servers[i]);
				_this.find('.list').append(html);
				fn();
			});
		}
	});
});
</script>